﻿@model Developer.Entity.Reviews

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <meta http-equiv="x-dns-prefetch-control" content="on" />
    <link rel="dns-prefetch" href="//fonts.googleapis.com" />
    <link rel="dns-prefetch" href="//secure.gravatar.com" />
    <link rel="dns-prefetch" href="//cdn.bootcss.com" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />

    <link href="~/Content/styles/kibo/normalize.css" rel="stylesheet" />
    <link href="~/Content/styles/kibo/style.css" rel="stylesheet" />
    <link href="~/Content/styles/kibo/schemes.css" rel="stylesheet" />
    <link href="~/Content/styles/kibo/highlight.css" rel="stylesheet" />
    <link href="~/Content/UI/css/animate.css" rel="stylesheet" />
    <link href="~/Content/UI/iconfont/iconfont.css" rel="stylesheet" />
    <style>
        body {
            color: rgba(80, 80, 80, 1);
            background: rgba(244, 244, 244, 0.8);
        }

        .contents img {
            width: 98%;
            box-shadow: rgba(0,0,0,0.5) 0 0.625rem 1.125rem;
            -webkit-box-shadow: rgba(0,0,0,0.5) 0 0.625rem 1.125rem;
            max-width: 91%;
            margin-bottom: 3.125rem;
            border-radius: .125rem;
        }
        .inactive {
            color: #C7C7CC;
        }

            .inactive:hover {
                color: #C7C7CC;
            }

            .inactive:visited {
                color: #C7C7CC;
            }
        span{
            font-size:14px;
        }
    </style>
    <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.slim.min.js"></script>
</head>
<body id="kibou-lite" class="pure">
    <div class="blog-masthead">
        <nav class="blog-nav" style="display: block; opacity: 1; transform: translateY(0px); filter: blur(0rem);">
            <a class="blog-nav-item" href="/Review/Index">返回书评</a>
            <a class="blog-nav-item" href="/Index/Home" title="归档">主页</a>

            <a class="blog-nav-item" href="" title="邻居">个人中心</a>
            <a class="blog-nav-item" href="" title="关于">查找</a>
        </nav>
        <div class="blog-title">
            <h1 class="blog-post-title" style="display: block; opacity: 1; transform: translateY(0px); filter: blur(0rem);">@Model.Title</h1>
            <p class="blog-post-meta" style="display: block; opacity: 1; transform: translateY(0px); filter: blur(0rem);">
                作者：
                <a href="">@Model.Users.NickName</a>&nbsp;• <time datetime="@Model.CreateTime+08:00" itemprop="datePublished">@(Model.CreateTime.Value.Month)月@(Model.CreateTime.Value.Day)日</time> • 点赞:  <span id="subscribe_count">@Model.Subscribe</span>
            </p>
            <input type="hidden" id="subscribe-count" value="@Model.Subscribe" />
        </div>

    </div>

    <div class="blog-container">
        <div class="blog-row">
            <div class="blog-main">
                <article id="article" class="blog" itemscope="" itemtype="http://schema.org/BlogPosting" style="background-color:rgba(244, 244, 244, 0.8);">
                    @Html.Raw(Model.Contents)

                </article>
                <ul class="article-switch">
                    <li class="prev"><a href="/Index/Home" title="主页">返回主页</a></li>
                    <li class="next"><a id="subscribe" title="点赞" class="">点赞</a></li>
                </ul>
            </div>
        </div>
    </div>
    <center>
        <footer class="blog-footer">
            <p>
                ©&nbsp;Copyright&nbsp;2017&nbsp;<a href="https://me.xczisland.cn/">czXu</a>
                |             <a href="http://www.miibeian.gov.cn" rel="nofollow" target="_blank">	苏ICP备16022039号</a>
            </p>
            <p>Theme <a style="cursor:default;" href="https://me.xczisland.cn/" target="_blank">Kibou Lite</a> made with ♥</p>
        </footer>
    </center>
    <script type="text/javascript">
        (function () {
            window.TypechoComment = {
                dom: function (id) {
                    return document.getElementById(id);
                },

                create: function (tag, attr) {
                    var el = document.createElement(tag);

                    for (var key in attr) {
                        el.setAttribute(key, attr[key]);
                    }

                    return el;
                },

                reply: function (cid, coid) {
                    var comment = this.dom(cid),
                        parent = comment.parentNode,
                        response = this.dom('respond-post-583'),
                        input = this.dom('comment-parent'),
                        form = 'form' == response.tagName ? response : response.getElementsByTagName('form')[0],
                        textarea = response.getElementsByTagName('textarea')[0];

                    if (null == input) {
                        input = this.create('input', {
                            'type': 'hidden',
                            'name': 'parent',
                            'id': 'comment-parent'
                        });

                        form.appendChild(input);
                    }

                    input.setAttribute('value', coid);

                    if (null == this.dom('comment-form-place-holder')) {
                        var holder = this.create('div', {
                            'id': 'comment-form-place-holder'
                        });

                        response.parentNode.insertBefore(holder, response);
                    }

                    comment.appendChild(response);
                    this.dom('cancel-comment-reply-link').style.display = '';

                    if (null != textarea && 'text' == textarea.name) {
                        textarea.focus();
                    }

                    return false;
                },

                cancelReply: function () {
                    var response = this.dom('respond-post-583'),
                        holder = this.dom('comment-form-place-holder'),
                        input = this.dom('comment-parent');

                    if (null != input) {
                        input.parentNode.removeChild(input);
                    }

                    if (null == holder) {
                        return true;
                    }

                    this.dom('cancel-comment-reply-link').style.display = 'none';
                    holder.parentNode.insertBefore(response, holder);
                    return false;
                }
            };
        })();
    </script>
    <script type="text/javascript">
        (function () {
            var event = document.addEventListener ? {
                add: 'addEventListener',
                focus: 'focus',
                load: 'DOMContentLoaded'
            } : {
                    add: 'attachEvent',
                    focus: 'onfocus',
                    load: 'onload'
                };

            document[event.add](event.load, function () {
                var r = document.getElementById('respond-post-583');

                if (null != r) {
                    var forms = r.getElementsByTagName('form');
                    if (forms.length > 0) {
                        var f = forms[0],
                            textarea = f.getElementsByTagName('textarea')[0],
                            added = false;

                        if (null != textarea && 'text' == textarea.name) {
                            textarea[event.add](event.focus, function () {
                                if (!added) {
                                    var input = document.createElement('input');
                                    input.type = 'hidden';
                                    input.name = '_';
                                    input.value = (function () {
                                        var _rxQ = 'd' //'v'
                                            + //'M'
                                            'M' + //'3'
                                            'c' + /* '15D'//'15D' */ '' + '6' //'a5'
                                            +
                                            '0ef' //'u1'
                                            + //'e7'
                                            'd3' + //'y'
                                            '6' + //'8aq'
                                            '8aq' + /* 'r'//'r' */ '' + //'AD'
                                            '4b' + //'oi6'
                                            '6' + 'e' //'X'
                                            +
                                            '2' //'Pdc'
                                            + //'P'
                                            'P' + //'iO'
                                            'feb' + '4b' //'l'
                                            +
                                            '' ///*'aq'*/'aq'
                                            +
												/* '8'//'8' */ '' + 'b' //'dw2'
                                            + //'jLW'
                                            '2' + //'LSJ'
                                            '663' + '0f4' //'WxS'
                                            +
                                            '2f4' //'jfP'
                                            + //'2Fu'
                                            '0' + 'f' //'Qiu'
                                            ,
                                            _7A5 = [
                                                [1, 2],
                                                [9, 12],
                                                [14, 15]
                                            ];

                                        for (var i = 0; i < _7A5.length; i++) {
                                            _rxQ = _rxQ.substring(0, _7A5[i][0]) + _rxQ.substring(_7A5[i][1]);
                                        }

                                        return _rxQ;
                                    })();

                                    f.appendChild(input);
                                    added = true;
                                }
                            });
                        }
                    }
                }
            });
        })();
    </script>
    <script src="~/Content/styles/kibo/js/highlight.js"></script>
    <script src="~/Content/styles/kibo/js/loadup.js"></script>
    @*<script src="//cdn.bootcss.com/instantclick/3.0.1/instantclick.min.js" data-no-instant=""></script>*@
    <script src="~/Content/scripts/jquery-1.10.2.min.js"></script>
    <script src="~/Scripts/jquery.unobtrusive-ajax.min.js"></script>
    <script>
        $("#subscribe").on("click", function () {
            $(this).addClass("inactive").removeAttr("id");
          
            var now_count = parseInt($("#subscribe-count").val()) + 1;

            $.ajax({
                url: '/Review/SetSubscribe',
                type: 'POST',
                dataType: 'Json',
                data: { rid: '@Model.Id', subscribe: now_count },
                success: function (data) {
                    console.log(data);
                }
            });
            //console.log(now_count);
            $("#subscribe_count").html(now_count);
        });
    </script>
    <script type="text/javascript">
        (function ($) {
            $.extend({
                tipsBox: function (options) {
                    options = $.extend({
                        obj: null,  //jq对象，要在那个html标签上显示
                        str: "+1",  //字符串，要显示的内容;也可以传一段html，如: "<b style='font-family:Microsoft YaHei;'>+1</b>"
                        startSize: "12px",  //动画开始的文字大小
                        endSize: "30px",    //动画结束的文字大小
                        interval: 600,  //动画时间间隔
                        color: "red",    //文字颜色
                        callback: function () { }    //回调函数
                    }, options);
                    $("body").append("<span class='num'>" + options.str + "</span>");
                    var box = $(".num");
                    var left = options.obj.offset().left + options.obj.width() / 2;
                    var top = options.obj.offset().top - options.obj.height();
                    box.css({
                        "position": "absolute",
                        "left": left + "px",
                        "top": top + "px",
                        "z-index": 9999,
                        "font-size": options.startSize,
                        "line-height": options.endSize,
                        "color": options.color
                    });
                    box.animate({
                        "font-size": options.endSize,
                        "opacity": "0",
                        "top": top - parseInt(options.endSize) + "px"
                    }, options.interval, function () {
                        box.remove();
                        options.callback();
                    });
                }
            });
        })(jQuery);

        function niceIn(prop) {
            prop.find('i').addClass('niceIn');
            setTimeout(function () {
                prop.find('i').removeClass('niceIn');
            }, 1000);
        }
        $(function () {
            $("#subscribe").click(function () {
                $.tipsBox({
                    obj: $(this),
                    str: "+1",
                    callback: function () {
                    }
                });
                niceIn($(this));
            });
        });
    </script>
</body>
</html>
